﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;
namespace map.member.money
{
    public partial class quxian : System.Web.UI.Page
    {
        protected cbuser user;
        protected void Page_Load(object sender, EventArgs e)
        {
            chatblog.Util.CheckBrokerOpr(this.Page);
            AjaxPro.Utility.RegisterTypeForAjax(typeof (AjaxFunction ));
            InitBaseInfo();
            if (!IsPostBack)
            {
               
            }
        }

        #region 辅助方法
        private void InitBaseInfo()
        {
            user = cbuser.Find("cbuserid='" + AliApi.appUserId + "'");             
        }

        protected string GetAccountNumber()
        {
            string result = string.Empty;
            if (user.Count > 0)
            {
                result = user.BankAccount.Value;
                if (result.Length > 7)
                {
                    string newResult = result;
                    result = string.Empty;
                    for (int i = 0; i < newResult.Length; i++)
                    {
                        if (i % 4 == 0 && i!=0)
                            result += " ";
                        if (i < 4 || i > newResult.Length - 4)
                            result += newResult[i].ToString();     
                        else
                            result += "*";                       
                    }
                }
            }
            return result;
        }
        #endregion

        #region 事件
        protected  void deleteBankInfo_ServerClick(object sender,EventArgs e)
        {
            if (AliApi.appUserId != string.Empty)
            {
                user.BankAccount.Value = "";
                user.BankAccountName.Value = "";
                user.BankBranchName.Value = "";
                user.BankName.Value = "";
                user.Modify();
                MessageBox.Show(this.Page,"删除成功！");
            }
        }
        #endregion

    }
}
